#ifndef CORE_MSAASAMPLE_H
#define CORE_MSAASAMPLE_H

#include "SampleBase.h"
#include "Types.h"
#include "Ray.h"
#include "HitableList.h"
#include "Sphere.h"
#include "ImageParam.h"
#include "Camera.h"
namespace RayTracer
{
	class MSAASample : public SampleBase 
	{
	public:
		MSAASample() = default;
		~MSAASample() = default;

		void Init();
		void Render();
		void ImGui();
		void ShutDown();
	private:
		vec3 RayColor(const Ray& ray, const Hitable& world);
		void Reset();
	private:
		int curIndex;
		bool isGenerate;
		ImageParam mImageParam; // output image
		int samples_per_pixel = 10;
		// scene
		HitableList world;
		std::shared_ptr<Sphere> sphere1;
		std::shared_ptr<Sphere> sphere2;
		// camera
		Camera camera;

		// viewport
		vec3 origin = vec3(0, 0, 0);
		vec3 horizontal;
		vec3 vertical;
		vec3 lower_left_corner;

		// sky color
		vec3 upColor;
		vec3 downColor;
		vec3 sphereColor;
		bool isNormal = true;
	};
}
#endif // !CORE_MSAASAMPLE_H
